package syntaxTree.methodDecl;

import syntaxTree.id.*;
import syntaxTree.type.*;
import syntaxTree.formalList.*;
import syntaxTree.stm.*;
import syntaxTree.exp.*;
import syntaxTree.varDecl.*;

public class methodDeclare extends methodDecl{  // -> public Type id(FormalList)  { VarDecl* Statement* return Exp*;}

	public methodDeclare(type t, id id, formalList forL, varDecl var, stm s, exp e)
	{
		this.md = new methodDeclInit();
		this.t = t;
		this.id = id;
		this.forL = forL;
		this.var = var;
		this.s = s;
		this.e = e;
	}
	public methodDeclare(type t, id id, formalList forL, varDecl var, exp e)
	{
		this.md = new methodDeclInit();
		this.t = t;
		this.id = id;
		this.forL = forL;
		this.var = var;
		this.s = new stmInit();
		this.e = e;
	}
	public methodDeclare(type t, id id, formalList forL, stm s, exp e)
	{
		this.md = new methodDeclInit();
		this.t = t;
		this.id = id;
		this.forL = forL;
		this.var = new varInit();
		this.s = s;
		this.e = e;
	}
	public methodDeclare(type t, id id, formalList forL, exp e)
	{
		this.md = new methodDeclInit();
		this.t = t;
		this.id = id;
		this.forL = forL;
		this.var = new varInit();
		this.s = new stmInit();
		this.e = e;
	}
	public methodDeclare(methodDecl md, type t, id id, formalList forL, varDecl var, stm s, exp e)
	{
		this.md = md;
		this.t = t;
		this.id = id;
		this.forL = forL;
		this.var = var;
		this.s = s;
		this.e = e;
	}
	public methodDeclare(methodDecl md, type t, id id, formalList forL, varDecl var, exp e)
	{
		this.md = md;
		this.t = t;
		this.id = id;
		this.forL = forL;
		this.var = var;
		this.s = new stmInit();
		this.e = e;
	}
	public methodDeclare(methodDecl md, type t, id id, formalList forL, stm s, exp e)
	{
		this.md = md;
		this.t = t;
		this.id = id;
		this.forL = forL;
		this.var = new varInit();
		this.s = s;
		this.e = e;
	}
	public methodDeclare(methodDecl md, type t, id id, formalList forL, exp e)
	{
		this.md = md;
		this.t = t;
		this.id = id;
		this.forL = forL;
		this.var = new varInit();
		this.s = new stmInit();
		this.e = e;
	}
	
	public String toString()
	{
		return (t.toString()+' '+id.toString()+" ( "+forL.toString()+" )\n{\n"+var.toString()+' '+s.toString()+"return "+e.toString()+";\n}\n");
	}
	public String toC()
	{
		return (t.toC()+' '+id.toC()+" ( "+forL.toC()+" )\n{\n"+var.toC()+' '+s.toC()+"return "+e.toC()+";\n}\n");
	}
}
